//
// Created by 李孝威 on 2021/4/7.
//

#ifndef SIGNLETON_SINGLETON_H
#include <iostream>
#define SIGNLETON_SINGLETON_H


class Singleton {
public:
    static const Singleton* getInstance();

    static void DoSomething() {
        std::cout << "do something" << std::endl;
    }

//    将构造函数私有化，防止外部访问
private:
    Singleton();
    ~Singleton();

    static Singleton* This; // 静态变量，存储在全局区，帮助解决资源的分配和释放
};


#endif //SIGNLETON_SINGLETON_H
